package chpt12.dao;

import java.time.LocalDate;

public class Student {
	private Long id;
	private String sno;
	private String name;
	private Double gpa;
	private LocalDate bday;

	// Constructor
	public Student() {
	}

	public Student(Long id, String sno, String name, Double gpa, LocalDate bday) {
		this.id = id;
		this.sno = sno;
		this.name = name;
		this.gpa = gpa;
		this.bday = bday;
	}

	// Getters and Setters
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getSno() {
		return sno;
	}

	public void setSno(String sno) {
		this.sno = sno;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getGpa() {
		return gpa;
	}

	public void setGpa(Double gpa) {
		this.gpa = gpa;
	}

	public LocalDate getBday() {
		return bday;
	}

	public void setBday(LocalDate bday) {
		this.bday = bday;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Student other = (Student) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Student [id=" + id + ", sno=" + sno + ", name=" + name + ", gpa=" + gpa + ", bday=" + bday + "]";
	}
	

}
